using System.Collections.Generic;
using System.Linq;
using UnityEngine;

[CreateAssetMenu(fileName = "Effect36-目标棋子降低一半攻击力,自己获得一半攻击力的提高", menuName = "Skill/Effect/Effect36-目标棋子降低一半攻击力,自己获得一半攻击力的提高", order = 36)]
public class Effect36 : EffectBase
{
    public override void Apply(Pair pair, GameEvent e, List<Chess> targets)
    {
        if(targets == null || targets.Count == 0) return;
        foreach (var chess in targets)
        {
            int targetAttack = chess.ChessDetail.Attack;
            chess.Buff((int)-targetAttack/2);
            pair.Chess.Buff((int)targetAttack/2);
        }
    }
}